home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet multimedia / Linux LiveCD / GeeXboX 1.0 EN / geexbox-1.0-en.i386.iso / GEEXBOX / sbin / init next >
Text File  |  2006-06-21  |  689b  |  34 lines

  1. #!/bin/sh
  2.  
  3. /bin/busybox test ! -e /proc/cpuinfo && /bin/busybox mount -t proc none /proc
  4. /bin/busybox test ! -e /sys/kernel && /bin/busybox mount -t sysfs none /sys
  5. /bin/busybox test ! -e /bin/cp && /bin/busybox --install -s
  6.  
  7. progress() {
  8.   if test -f /proc/splash; then
  9.     echo "show $1" > /proc/splash
  10.   fi
  11. }
  12.  
  13. count=0
  14. for script in /etc/init.d/*; do
  15.   grep -q -e "^# runlevels:.*$1" $script && count=$(($count+1));
  16. done
  17.  
  18. pos=47000
  19. step=$(((65535-$pos)/$count))
  20.  
  21. RET=0
  22.  
  23. for script in /etc/init.d/*; do
  24.   if grep -q -e "^# runlevels:.*$1" $script; then
  25.     pos=$(($pos+$step))
  26.     progress $pos
  27.     /bin/sh $script
  28.     S_RET=$?
  29.     test $S_RET -ge $RET && RET=$S_RET
  30.   fi
  31. done
  32.  
  33. exit $RET
  34.